package net.towee.model.discussion;

import java.util.LinkedList;
import java.util.List;

import com.google.gwt.user.client.rpc.IsSerializable;


/**
 * This model consists of some add/remove message methods.
 * @author   c58
 */
public interface Discussion extends IsSerializable  {
	/**
	 * Add new message to and of container
	 * @param comment
	 */
	void addMessage(Message comment);
	
	/**
	 * Add new message to container. If direction is true it
	 * add message to end, false otherwise
	 * @param comment
	 */
	void addMessages(boolean direction, List<Message> comment);
	
	/**
	 * Remove message from container
	 * @param comment
	 */
	void removeMessage(Message comment);
	
	/**
	 * @return list of messages
	 */
	LinkedList<Message> getMessagesList();
	
	/**
	 * @return number of comments in container
	 */
	int getCount();

	/**
	 * Set messages list
	 * @param subList
	 */
	void setMessages(LinkedList<Message> subList);

	/**
	 * Get message with given id or null if not exists
	 * @param id
	 */
	Message getMessage(String id);
}
